import { CARTLIST } from './mutations-types'
import {getCartList} from '@/service/get-data'
export default{
  async fetchCartList ({commit}) {
    let res = await getCartList()
    return new Promise((resolve, reject) => {
      if (res.data && res.data.resultCode && res.data.resultCode === 2000) {
        commit(CARTLIST, res.data)
        resolve(res.data.data)
      }
    })
  }
}
